import Vue from 'vue'

import Vuex from "vuex";


// 1.安装插件
Vue.use(Vuex)

const store = new Vuex.Store({

  status: {
    userInfo: null
  },
  mutations: {
    initUserInfo(state, payload) {
      state.userInfo = payload
    },
    delUserInfo(state) {
      state.userInfo = null
      sessionStorage.removeItem('userInfo');
    }
  },
  actions: {},
  getters: {},
  modules: {}
})

// 3.导出store独享
export default store